package com.yc.Leetcode.Tree;

public class _111_二叉树的最小深度 {
    public int minDepth(TreeNode root) {
        if(root == null) return 0;
        int left = minDepth(root.left);
        int right = minDepth(root.right);
        if (root.left == null || root.right == null) return left + right + 1;
        return Math.min(left,right) + 1;
    }
}
